package thread;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class Thread30 {
  public static void main(String[] args) {
    ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2);
    scheduledExecutorService.schedule(() -> {
      System.out.println(Thread.currentThread().getName());
      System.out.println("这里打印执行线程名称 ...");
    }, 2, TimeUnit.SECONDS);
    
    while (true) {
    }
  }
}
